package com.sunday.shoufen.ui;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.sunday.common.base.BaseActivity;
import com.sunday.shoufen.R;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

import static com.sunday.shoufen.http.ApiClient.WEB_URL;

/**
 * Created by 刘涛 on 2017/11/2.
 */

public class AboutUsActivity extends BaseActivity {

    @Bind(R.id.left_btn)
    ImageView leftBtn;
    @Bind(R.id.title_view)
    TextView titleView;
    @Bind(R.id.rightTxt)
    TextView rightTxt;
    @Bind(R.id.right_btn)
    ImageView rightBtn;
    @Bind(R.id.common_header)
    RelativeLayout commonHeader;
    @Bind(R.id.intro)
    TextView intro;
    @Bind(R.id.service)
    TextView service;
    @Bind(R.id.help)
    TextView help;

    private String WEB_INTRO = "gsjs";
    private String WEB_SERVICE = "fwtk";
    private String WEB_HELP = "sybz";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about_us);
        ButterKnife.bind(this);
        titleView.setText("关于我们");
    }

    private String url;

    @OnClick({R.id.intro, R.id.service, R.id.help})
    void onClick(View v) {
        switch (v.getId()) {
            case R.id.intro:
                intent = new Intent(mContext, WebViewActivity.class);
                url = String.format(WEB_URL + WEB_INTRO);
                intent.putExtra("url", url);
                intent.putExtra("title", intro.getText());
                startActivity(intent);

                break;
            case R.id.service:
                intent = new Intent(mContext, WebViewActivity.class);
                url = String.format(WEB_URL + WEB_SERVICE);
                intent.putExtra("url", url);
                intent.putExtra("title", service.getText());
                startActivity(intent);
                break;
            case R.id.help:
                intent = new Intent(mContext, WebViewActivity.class);
                url = String.format(WEB_URL + WEB_HELP);
                intent.putExtra("url", url);
                intent.putExtra("title", help.getText());
                startActivity(intent);
                break;
        }
    }
}
